<?php

namespace app\seller\model;

use think\Model;

class CapitalLog extends Model
{
    // 表名
    protected $name = 'capital_log';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;

    // 定义时间戳字段名
    protected $createTime = false;
    protected $updateTime = false;
    
    // 追加属性
    protected $append = [
        'cate_text'
    ];


    public function getCateList()
    {
        return ['money' => __('余额'),'point' => __('积分'),'phone_money' => __('话费'),'voucher_money' => __('优惠券')];
    }

    public function getCateTextAttr($value, $data)
    {
        $value = $value ? $value : $data['cate'];
        $list = $this->getSaleList();
        return isset($list[$value]) ? $list[$value] : '';
    }







}
